package com.hae.shop.micoshopportalweb.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.core.userdetails.UserDetailsService;

/**
 * 去掉springsecurity表单验证
 * 详情访问https://cloud.tencent.com/developer/article/1437763
 */
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    @Override  public void configure(WebSecurity web) {
        web.ignoring().anyRequest();
    }

    /**
     * 去掉springsecurity验证的日志
     * @return
     */
    @Bean
    public UserDetailsService userDetailsService() {
        return (userName) -> {
            return null;
        };
    }

}
